gtk-builder-tool: Accept --help
authorMatthias Clasen <mclasen@redhat.com>
Sun, 31 Jan 2016 16:01:46 +0000 (11:01 -0500)
committerMatthias Clasen <mclasen@redhat.com>
Sun, 31 Jan 2016 16:02:53 +0000 (11:02 -0500)
Saying 'Failed to open file '--help' is not polite or smart.
Catch this case and show usage information.

gtk/gtk-builder-tool.c

index 182577f13ecb1c1b254684bc7c537f8b117bf2ee..bc18b38fe7817a1b75a10bf9d9bfb22376987f8a 100644 (file)
@@ -913,6 +913,9 @@ main (int argc, char *argv[])
   if (argc < 3)
     usage ();
 
+  if (strcmp (argv[2], "--help") == 0)
+    usage ();
+
   if (strcmp (argv[1], "validate") == 0)
     do_validate (argv[2]);
   else if (strcmp (argv[1], "simplify") == 0)